package network1;

import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;

public class SendDemo {
    public static void main(String[] args) throws IOException {
        //创建发送端的socket
        DatagramSocket socket = new DatagramSocket();
        byte[] bys = "hello,WHB".getBytes();
        DatagramPacket packet = new DatagramPacket(bys, bys.length, InetAddress.getByName("127.0.0.1"), 9999);
        socket.send(packet);
        socket.close();

    }

}
